<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改风险登记册')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-register-edit" th:object="${pmpRiskRegister}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">项目id：</label>
                <div class="col-sm-8">
                    <input name="projectId" th:field="*{projectId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">风险名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">风险描述：</label>
                <div class="col-sm-8">
                    <textarea name="description" th:field="*{description}" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">风险类型：</label>
                <div class="col-sm-8">
                    <select name="type" class="form-control m-b" th:with="type=${@dict.getType('pmp_risk_type')}">
                        <option th:each="dict : ${type}"
                                th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}"
                                th:selected="${pmpRiskRegister.type == dict.dictValue}" ></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">风险来源：</label>
                <div class="col-sm-8">
                    <select name="source" class="form-control m-b" th:with="type=${@dict.getType('pmp_risk_source')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                                th:selected="${pmpRiskRegister.source == dict.dictValue}" ></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">事件：</label>
                <div class="col-sm-8">
                    <textarea name="event" th:field="*{event}" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">后果：</label>
                <div class="col-sm-8">
                    <textarea name="consequence" th:field="*{consequence}" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">发生概率：</label>
                <div class="col-sm-8">
                    <input name="probability" th:field="*{probability}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">责任人：</label>
                <div class="col-sm-8">
                    <input name="directorName" th:field="*{directorName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">应对策略：</label>
                <div class="col-sm-8">
                    <textarea name="responseStrategy" th:field="*{responseStrategy}" class="form-control" type="text"></textarea>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/register";
        $("#form-register-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-register-edit').serialize());
            }
        }
    </script>
</body>
</html>
